package com.yc.framework.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

/**
 * 线程池配置
 *
 * @Author YanChen
 * @Date 2025/4/13 10:29
 **/
@Configuration
public class ExecutorConfig {

    /**
     * 配置异步任务调度线程池
     */
    @Bean(name = "scheduledExecutorService")
    public ScheduledExecutorService scheduledExecutorService() {
        return Executors.newScheduledThreadPool(5);
    }
}
